package com.example.stock.comm;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

@Getter
@AllArgsConstructor
public enum IndexCodeEnum {

    SZ50("000016.SH", "上证50"),
    CYB50("399673.SZ", "创业板50"),
    HS300 ("399300.SZ", "沪深300"),
    KC50 ("000688.SH", "科创50"),
    ZZ500 ("000905.SH", "中证500"),
    ;

    private String tsCode;

    private String name;

    public static List<String> listTsCode(){
        IndexCodeEnum[] values = IndexCodeEnum.values();
        List<String> collect = Arrays.asList(values).stream().map(s -> s.getTsCode()).collect(Collectors.toList());
        return collect;
    }
}
